var s = " hello world!  ";
var res = s
  .split(" ")
  .reverse()
  .filter((item) => item.trim().length > 0);
let r = res.join(" ");
console.log(r);
